﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PurchaseIntoCheck.aspx.cs" Inherits="Automobile.service.UI.PurchaseIntoCheck" %>

<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="Bookmark" href="/favicon.ico">
    <link rel="Shortcut Icon" href="/favicon.ico" />
    <!--[if lt IE 9]>
<script type="text/javascript" src="lib/html5.js"></script>
<script type="text/javascript" src="lib/respond.min.js"></script>
<script type="text/javascript" src="lib/PIE_IE678.js"></script>
<![endif]-->
    <link rel="stylesheet" type="text/css" href="static/h-ui/css/H-ui.min.css" />
    <script src="js/jquery-1.8.2.min.js"></script>
    <link rel="stylesheet" type="text/css" href="static/h-ui.admin/css/H-ui.admin.css" />
    <link rel="stylesheet" type="text/css" href="lib/Hui-iconfont/1.0.7/iconfont.css" />
    <link rel="stylesheet" type="text/css" href="lib/icheck/icheck.css" />
    <link rel="stylesheet" type="text/css" href="static/h-ui.admin/skin/default/skin.css" id="skin" />
    <link rel="stylesheet" type="text/css" href="static/h-ui.admin/css/style.css" />
    <!--[if IE 6]>
<script type="text/javascript" src="lib/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
    <title>商品列表</title>
</head>
<body>
    <form runat="server">

        <div class="page-container">


            



            <asp:Repeater ID="Repeater1" runat="server" >
                <HeaderTemplate>
                    <%-- 头模板--%>
                    <table class="table table-border table-bordered table-bg">
                        <thead>
                            <tr>
                                <th scope="col" colspan="9">采购订单审核</th>
                            </tr>
                            <tr class="text-c">
                                <th>采购编码</th>
                                <th>采购单号</th>
                                <th>制单日期</th>
                                <th>商品总额</th>
                                <th>供应商</th>
                                <th>仓库</th>
                                <th>经办人</th>
                            </tr>
                        </thead>
                </HeaderTemplate>
                <ItemTemplate>
                    <%--项模板--%>

                    <tr class="text-c">
                        <td><%#Eval("Purchase_Id") %></td>
                        <td><%#Eval("Purchase_curom") %></td>
                        <td><%#Eval("Purchase_date") %></td>
                        <td><%#Eval("SumMoney") %></td>
                        <td><%#Eval("Supplier_Name") %></td>
                        <td><%#Eval("WareHose_Name") %></td>
                        <td><%#Eval("Employee_Name") %></td>
                    </tr>

                </ItemTemplate>
                <FooterTemplate>
                    <%--尾部模板--%>
                   </table>
                </FooterTemplate>
            </asp:Repeater>
            <br />
            <table class="table table-border table-bordered table-bg table-hover table-sort" id="psser">
                <thead>
                    <tr class="text-c">
                        <th>子编码</th>
                        <th>商品名称</th>
                        <th>采购数量</th>
                        <th>价格</th>
                    </tr>
                    
                </thead>
                <tbody>
                </tbody>

            </table>

            <input type="button" onclick="add()" value="审核完成并入库" />

        </div>
        <script type="text/javascript" src="lib/jquery/1.9.1/jquery.min.js"></script>
        <script type="text/javascript" src="lib/layer/2.1/layer.js"></script>
        <script type="text/javascript" src="lib/laypage/1.2/laypage.js"></script>
        <script type="text/javascript" src="lib/My97DatePicker/WdatePicker.js"></script>
        <script type="text/javascript" src="static/h-ui/js/H-ui.js"></script>
        <script type="text/javascript" src="static/h-ui.admin/js/H-ui.admin.js"></script>
        <script type="text/javascript">

        </script>
    </form>
</body>
</html>
<script>
    $(function () {
        var url = document.location.href;
        var url1 = url.split("=")[1];
        $.ajax({
            type: "post",
            url: "Handler/HandlerIntoMate.ashx",
            data: {
                id: url1,
            },
            success: function (data) {
               
                var data1 = eval(data);
                $(data1).each(function (index, item) {
                    var str = "<tr class='text-c'><td>" + item.PurchaseMate_Id + "</td><td>" + item.Product_Name + "</td><td>" + item.PurchaseMate_Num + "</td><td>" + item.PurchaseMate_Price + "</td></tr>"
                    $("#psser tbody").append(str);
                })
            }
        })
    })
    function add() {
        var url = document.location.href;
        var url1 = url.split("=")[1];
        $.ajax({
            type: "post",
            url: "Handler/HandlerIntoWarehouse.ashx",
            data: {
                id: url1,
            },
            success:function(data){
                if (data > 0) {
                    alert("入库了");
                    
                }
                else {
                    alert("no！no！no！no！no！no！no！");
                }
        }
        })
    }
</script>

